// 引入封装好的request
import request from '@/utils/request'

// 查询企业的部门列表 获取部门数据
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 根据id删除部门
export function delDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据ID查询部门详情
export function getIdDepartments(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 根据ID修改部门详情 编辑
export function editDepartments(data) {
  return request({
    url: '/company/department/' + data.id
  })
}
